home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / appletalk / netatalk / afs / afskrbsrc.sit.hqx / AFS Kerberos 1.0B0 / log.a < prev    next >
Encoding:
Text File  |  1991-03-08  |  2.7 KB  |  99 lines

  1. ;*
  2. ;* Routines to set up global A5 space
  3. ;*
  4. ; * Copyright (c) 1990 Regents of The University of Michigan.
  5. ; * All Rights Reserved.
  6. ; *
  7. ; * Permission to use, copy, modify, and distribute this software
  8. ; * and its documentation for any purpose and without fee is hereby
  9. ; * granted, provided that the above copyright notice appears in all
  10. ; * copies and that both that copyright notice and this permission
  11. ; * notice appear in supporting documentation, and that the name of
  12. ; * The University of Michigan not be used in advertising or
  13. ; * publicity pertaining to distribution of the software without
  14. ; * specific, written prior permission. This software is supplied as
  15. ; * is without expressed or implied warranties of any kind.
  16. ; *
  17. ; *    ITD Research Systems
  18. ; *    University of Michigan
  19. ; *    535 W. William Street
  20. ; *    Ann Arbor, Michigan
  21. ; *    +1-313-936-2652
  22. ; *    netatalk@terminator.cc.umich.edu
  23. ; *
  24.  
  25.     Case        OBJ
  26.     Print        OFF
  27.     Include     'Traps.a'
  28.     Include     'QuickEqu.a'
  29.     Load        'ProgStrucMacs.d'
  30.     Load        'FlowCtlMacs.d'
  31.     Print        ON
  32.                 
  33.     Import        NewPtr
  34.     Import        A5Size
  35.     Import        A5Init
  36.     Import        A5Dispose
  37.  
  38. QUICKDRAW    RECORD    IMPORT,DECREMENT
  39. thePort         DS.L        1
  40. white            DS.B        8
  41. black            DS.B        8
  42. gray            DS.B        8
  43. ltGray            DS.B        8
  44. dkGray            DS.B        8
  45. arrow            DS.B        cursRec
  46. screenBits        DS.B        14
  47. randSeed        DS.L        1
  48.                 ENDR
  49.                 
  50. uam_mem        dc.l        0
  51.  
  52.  
  53. export    procedure    myseta5
  54.      begin    Save=A0-A4/D1-D6
  55.     jsr            A5Size                ; get length (in D0)
  56.     addi.l        #206,D0                ; add room below for QuickDraw globals 
  57.     move.l        D0,-(SP)            ; save the length
  58.     addi.l        #$20,D0                ; add room above new A5 for appl. params
  59.     _NewPtr                         ; allocate new area
  60.     cmp.l        #0,A0                ; check for success
  61.     bnz.s        memok                 ;
  62.     addq.l        #4,SP                ; clean up the stack
  63.     move.l        #-1,D0                ; return with error
  64.     return
  65.                 
  66. memok
  67.     move.l        (SP)+,D0            ; retrieve the length
  68.     move.l        A1,-(SP)            ; save A1
  69.     lea            uam_mem,A1            ; store ptr to our A5 memory so we can free on close
  70.     move.l        A0,(A1)                 ;
  71.     add.l        A0,D0                ; DO points to end of new region
  72.     move.l        D0,D5                ; save new A5 value
  73.     move.l        A5,D6                ; save old A5 value
  74.     move.l        D0,-(SP)            ; build new global area
  75.     jsr            A5Init                 ;
  76.     addq.l        #4,SP                ; clean up stack
  77.     
  78.     move.l        (A5),A0                ; get pointer to start of quickdraw globals
  79.     lea            randSeed(A0),A0         ;
  80.     move.l        D5,A5                ; set A5 & get new quickdraw globals pointer
  81.     lea            QUICKDRAW.randSeed,A1    
  82.     move.l        #-randSeed,D0        ; copy current globals to new area
  83.     _BlockMove                          ;
  84.     move.l        (SP)+,A1            ; restore A1
  85.     move.l        D6,D0                ; return old A5 value
  86.     return
  87.     
  88. export    procedure    myrestorea5
  89.      begin        Save=A0-A4
  90.     link        A4,#0                ; set up frame ptr
  91.     move.l        #28,A1                ; get old A5 ptr (passed in)
  92.     add.l        A4,A1                 ;
  93.     move.l        (A1),A5                ; restore old A5
  94.     move.l        uam_mem,A0            ; free the memory we allocated
  95.     _DisposPtr                         ;
  96.     unlk        A4
  97.     return
  98.  
  99.     end